<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>map</title>
</head>
<body>
        <script>
            var arr = [1,2,3,4,5];
            Array.prototype.myMap = function (callback) {
                var arr = this.valueOf();
                var anwArr = [];
                for (var i = 0;i<arr.length;i++){
                    newArr.push(callback(arr[i],i,arr))
                }
                return newArr;
            };
            var fun2 = function (v) {
                return v+200;
            };
            var arr2 = arr.myMap(fun2);
            console.log(arr2)
        </script>
</body>
</html>